package rpc.protocol.header;


import rpc.common.id.IdFactory;
import rpc.constants.RpcConstants;
import rpc.protocol.enumeration.RpcType;

/**
 * @author binghe(公众号：冰河技术)
 * @version 1.0.0
 * @description RpcHeaderFactory
 */
public class RpcHeaderFactory {

    public static RpcHeader getRequestHeader(String serializationType,int message){
        RpcHeader header = new RpcHeader();
        long requestId = IdFactory.getId();
        header.setMagic(RpcConstants.MAGIC);
        header.setRequestId(requestId);
        header.setMsgType((byte) message);
        header.setStatus((byte) 0x1);
        header.setSerializationType(serializationType);
        return header;
    }
}
